package com.dcw.lixb.designmode.singleinstance;

/**
 * @author lixiaobin
 * @date 2020-07-16 17:25:21
 * @desc 懒汉式，线程不安全
 * 是否 Lazy 初始化：是
 *
 * 是否多线程安全：否
 *
 * 实现难度：易
 */
public class SingleB {
    private static SingleB sSingleB;

    private SingleB() {
        try {
            Thread.sleep(200L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static SingleB getInstance() {
        if (null == sSingleB) {
            sSingleB = new SingleB();
        }
        return sSingleB;
    }
}
